# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=strawberry
pkgver=1.0.23
pkgrel=1
pkgdesc="Strawberry Music Player"
url="https://strawberrymusicplayer.org"
arch="all"
license="GPL-3.0-or-later"
depends="gst-plugins-base gst-plugins-good qt6-qtbase-sqlite icu-data-full"
makedepends="
	alsa-lib-dev
	boost-dev
	chromaprint-dev
	cmake
	dbus-dev
	fftw-dev
	glib-dev
	gnutls-dev
	gst-plugins-base-dev
	gstreamer-dev
	icu-dev
	libcdio-dev
	libgpod-dev
	libmtp-dev
	libxcb-dev
	protobuf-dev
	pulseaudio-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	sparsehash
	sqlite-dev
	taglib-dev
"
checkdepends="gtest-dev xvfb-run"
subpackages="$pkgname-doc"
source="https://files.strawberrymusicplayer.org/strawberry-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DBUILD_WITH_QT6=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	xvfb-run -a cmake --build build --target run_strawberry_tests
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f3249e97b2f0130dadf2a5fcfc128d7054accd6b86cf088a3a45549c584529aefbadaf09e9ed074af85c679495b03ad700e78f6952e913a40b38eaf7c77d5adb  strawberry-1.0.23.tar.xz
"
